(function($) {

    $.day ;
    $.hour;
    $.minute;
    $.second;

    $.init = function(time)
    {
        $.day    = parseInt(time / 86400),
        $.hour   = parseInt( ( time - ($.day * 86400) ) / 3600 ),
        $.minute = parseInt( ( time - ($.day * 86400) - ($.hour * 3600) ) / 60 ),
        $.second = parseInt( time - ($.day * 86400) - ($.hour * 3600) - ($.minute * 60) );

        $.minute = ($.minute < 10) ? ('0' + $.minute) : $.minute;
        $.second = ($.second < 10) ? ('0' + $.second) : $.second;

        // console.log(time, $.day, $.hour, $.minute, $.second);
    }

    $.S = function(time) {
        $.init(time);
        return $.second;
    }

    $.MS = function(time) {
        $.init(time);
        return $.minute + ':' + $.second;
    }

    $.HMS = function(time) {
        $.init(time);
        return $.hour + '时 ' + $.minute + '分 ' + $.second + '秒';
    }

    $.DHMS = function(time) {
        $.init(time);
        return $.day + '天 ' + $.hour + '时 ' + $.minute + '分 ' + $.second + '秒';
    }

})(Time = {});